package com.gjt.udp;

import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;

/**
 * Created with Intel IDEA.
 *
 * @Auther: gjt
 * @Date: 2024/10/27 14:45
 */
public class SearchUDPSocket {
    public static void main(String[] args) {
        for (int i = 0; i < 65535; i++) {
            try{
                DatagramSocket datagramSocket = new DatagramSocket(i);
                datagramSocket.close();
            }catch (IOException e){
                System.out.println( "服务端口" +i);
            }

        }
    }
}
